<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
	<head>
		<meta charset="UTF-8">
		<title>管理员后台</title>
		<link rel="stylesheet" type="text/css" th:href="@{/css/cart.css}" />
		<link rel="stylesheet" type="text/css" th:href="@{/dist/css/bootstrap.min.css}">
		<link rel="stylesheet" type="text/css" th:href="@{/css/index.css}"/>
		<link rel="stylesheet" type="text/css" th:href="@{/css/animate.css}"/>
		<link rel="stylesheet" th:href="@{/layui/css/layui.css}">

	</head>

	<body>
	<!--导航部分  begin-->
	<div th:replace="admin/common/header :: nav"></div>
	<!--导航部分 end-->

	<div class="container">
		<!--左边-->
		<div class="col-md-8 col-sm-12" style="width:100%">
			<!--左边-->
			<ol class="breadcrumb">
				<li>
					<a href="#" class="pointer-evens:none"><span class="glyphicon glyphicon-book"></span>&nbsp;&nbsp;更新图书</a>
				</li>
			</ol>

			<!--购物车表格 begin-->
			<div class="table-responsive" id="imgDiv">
				<form class="layui-form" method="post" th:action="@{/admin/updateBook}" enctype="multipart/form-data">
					<input type="hidden" th:value="${book.id}" name="id">
					<div class="layui-form-item">
						<label class="layui-form-label">ISBN</label>
						<div class="layui-input-block">
							<input type="text" name="isbn"    placeholder="请输入ISBN" th:value="${book.isbn}" autocomplete="off" class="layui-input">
						</div>
					</div>
					<div class="layui-form-item">
						<label class="layui-form-label">书名</label>
						<div class="layui-input-block">
							<input type="text" name="name"    placeholder="请输入书名" th:value="${book.name}" autocomplete="off" class="layui-input">
						</div>
					</div>
					<div class="layui-form-item">
						<label class="layui-form-label">作者</label>
						<div class="layui-input-block">
							<input type="text" name="author"    placeholder="请输入作者" th:value="${book.author}" autocomplete="off" class="layui-input">
						</div>
					</div>

					<div class="layui-form-item">
						<label class="layui-form-label">出版社</label>
						<div class="layui-input-block">
							<input type="text" name="publisher"    placeholder="请输入出版社" th:value="${book.publisher}" autocomplete="off" class="layui-input">
						</div>
					</div>
					<div class="layui-form-item">
						<label class="layui-form-label">出版日期</label>
						<div class="layui-input-block">
							<input type="text" name="pubDate" th:value="${#calendars.format(book.publishDate,'yyyy-MM-dd HH:mm:ss')}" class="layui-input" id="test1">
						</div>
					</div>
					<div class="layui-form-item">
						<label class="layui-form-label">原价（元）</label>
						<div class="layui-input-block">
							<input type="text" name="oldPrice"  th:placeholder="${book.oldPrice}" th:value="${book.oldPrice}" disabled autocomplete="off" class="layui-input">
						</div>
					</div>

					<div class="layui-form-item">
						<label class="layui-form-label">现价（元）</label>
						<div class="layui-input-block">
							<input type="text" name="newPrice"    placeholder="请输入现价"  required  lay-verify="required" autocomplete="off" class="layui-input">
						</div>
					</div>
					<div class="layui-form-item">
						<label class="layui-form-label">库存</label>
						<div class="layui-input-block">
							<input type="text" name="newPrice"    placeholder="库存"  required th:value="${book.count}" lay-verify="required" autocomplete="off" class="layui-input">
						</div>
					</div>
					<div class="layui-form-item">
						<label class="layui-form-label">原封面</label>
						<div class="layui-input-block">
							<img th:src="@{'/public/' + ${book.imgUrl}}" alt="">
						</div>
					</div>
					<div class="layui-form-item">
						<label class="layui-form-label">新封面</label>
						<div class="layui-input-block">
							<input type="file" name="bookPic" class="layui-btn" required  lay-verify="required">
						</div>
					</div>
					<div class="layui-form-item">
						<label class="layui-form-label">分类</label>
						<div class="layui-input-block">
							<input type="radio" name="cate" value="文学类" title="文学类" th:checked="${book.cate=='文学类'}">
							<input type="radio" name="cate" value="经管类" title="经管类" th:checked="${book.cate=='经管类'}">
							<input type="radio" name="cate" value="其他类" title="其他类" th:checked="${book.cate=='其他类'}">
						</div>
					</div>
					<div class="layui-form-item layui-form-text">
						<label class="layui-form-label">简介</label>
						<div class="layui-input-block">
							<textarea name="info" placeholder="请输入内容" th:placeholder="${book.info}" th:value="${book.info}" class="layui-textarea"></textarea>
							<input type="hidden" name="oldInfo" th:value="${book.info}">
						</div>
					</div>
					<div class="layui-form-item">
						<div class="layui-input-block">
							<!-- <button class="layui-btn" lay-submit lay-filter="formDemo">立即提交</button> -->
							<input type="submit" class="layui-btn" lay-submit value="提交">
							<button type="reset" class="layui-btn layui-btn-primary">重置</button>
						</div>
					</div>
				</form>
			</div>
			<!--购物车 end-->

		</div>


	</div>


		<!--首页底部信息 begin-->
		<div class="container">

		<div th:replace="common/footer :: footer"></div>
		</div>
		<!--end-->

		<!--引入js文件-->
		<script src="js/details.js" th:src="@{/js/details.js}" type="text/javascript" charset="utf-8"></script>
		<script src="js/cart.js" th:src="@{/js/cart.js}" type="text/javascript" charset="utf-8"></script>
		<script src="dist/js/jquery.min.js" th:src="@{/dist/js/jquery.min.js}"></script>
		<script src="js/carousel.js" th:src="@{/js/carousel.js}" type="text/javascript" charset="utf-8"></script>
		<script src="dist/js/bootstrap.min.js" th:src="@{/dist/js/bootstrap.min.js}"></script>
		<script src="js/wow.js" th:src="@{/js/wow.js}"></script>
		<script th:src="@{/layui/layui.js}"></script>
		<script th:inline="javascript">
			//获取应用路径
			var contextPath = [[${#request.getContextPath()}]];
			var pages = [[${pages}]];
			var admin = [[${session.admin}]]

		</script>
		<script>
			layui.use('laydate', function(){
				var laydate = layui.laydate;

				//执行一个laydate实例
				laydate.render({
					elem: '#test1', //指定元素
					type: 'datetime'
				});
			});
		</script>
		<script type="text/javascript">
			$(function () {
				if (admin == null || admin == undefined || admin == 'undefined') {
					location.href = contextPath + "/book/index";
				}
			})
			if(!(/msie [6|7|8|9]/i.test(navigator.userAgent))) {
				new WOW().init();
			};

		</script>

	<style type="text/css">
		td {text-align: center}
		th {text-align: center}
	</style>
	</body>

</html>